#if (FEATURE_MODE == 0)

/**
 @file sys_usw_g8031.h

 @date 2019-8-27

 @version v6.0

  The file defines Macro, stored data structure for G8031
*/
#ifndef _SYS_USW_G8031_H
#define _SYS_USW_G8031_H
#ifdef __cplusplus
extern "C" {
#endif

#include "sal.h"
/****************************************************************************
 *
 * Header Files
 *
****************************************************************************/

/****************************************************************************
*
* Defines and Macros
*
****************************************************************************/

/****************************************************************************
*
* Global and Declaration
*
*****************************************************************************/

/****************************************************************************
 *
* Function
*
****************************************************************************/

enum g8031_events_e
{
    G8031_NO_REQUEST = 0,                      /* NR */
    G8031_DO_NOT_REVERT = 1,                   /* DNR */
    G8031_REVERSE_REQUEST = 2,                 /* RR */
    G8031_STATE_3_INVALID = 3,
    G8031_EXERCISE = 4,                        /* EXER */
    G8031_WAIT_TO_RESTORE = 5,                 /* WTR */
    G8031_STATE_6_INVALID = 6,
    G8031_MANUAL_SWITCH = 7,                   /* MS */
    G8031_STATE_8_INVALID = 8,
    G8031_SIGNAL_DEGRAGE = 9,                  /* SD */
    G8031_STATE_10_INVALID = 10,
    G8031_SIGNAL_FAIL_FOR_WORKING = 11,        /* SF */
    G8031_STATE_12_INVALID = 12,
    G8031_FORCED_SWITCH = 13,                  /* FS */
    G8031_SIGNAL_FAIL_FOR_PROTECTION = 14,     /* SF-P */
    G8031_LOCKOUT_OF_PROTECTION = 15,          /* LO */
    G8031_LOP = 16,
    G8031_FS,
    G8031_SF_W,
    G8031_W_RECOVERS_FROM_SF,
    G8031_SF_P,
    G8031_P_RECOVERS_FROM_SF,
    G8031_MS_TO_P,
    G8031_MS_TO_W,
    G8031_CLEAR,
    G8031_EXER,
    G8031_WTR_EXPIRES,
    G8031_W_RECOVERS_FROM_SD,
    G8031_P_RECOVERS_FROM_SD,
    G8031_SD_W,
    G8031_SD_P,
    G8031_EVENTS_MAX
};
typedef enum g8031_events_e g8031_events_t;


struct g8031_aps_group_s
{
    uint32 aps_channel:1,
              bridge_permanent:1,
              direction:1,
              is_revertive:1,
              requested_signal:1,
              bridged_signal:1,
              last_state:5,
              current_state:5,
              is_protection:1,
              current_event:6,
              aps_grp_id:8,
              protection_path_valid:1;

    uint32 wtr_timer:8,
              wtr_while:8,
              working_path:8,
              protection_path:8;

    uint32 active_path:8,
              lchip:8,
              local_freeze:1,
              local_lockout:1,
              enable:1,
              far_end_last_state:5,
              aps_mismatch:1,
              reassert_req:7;
     uint32 working_mac:10,
              protection_mac:10,
              rsv0:12;
};
typedef struct g8031_aps_group_s g8031_aps_group_t;



struct g8031_aps_pdu_s
{
   uint32    req_state:5,
                a:1,
                b:1,
                d:1,
                r:1,
                req_signal:1,
                bridged_signal:1,
                rsv:21;
};
typedef struct g8031_aps_pdu_s g8031_aps_pdu_t;
#if defined E_UNIT && (FEATURE_MODE == 0)
struct sys_sc_oam_set_aps_hw_s
{
    g8031_aps_group_t aps_grop;
    g8031_aps_pdu_t aps_pdu;
    uint8 type;
};
typedef struct sys_sc_oam_set_aps_hw_s sys_sc_oam_set_aps_hw_t;
#endif
#ifdef __cplusplus
}
#endif


#endif

#endif
